<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://tickettoride.woodstock.net.br/tld/ttr" prefix="ttr" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Ticket To Ride - Sample App</title>
</head>
<body>
	<form id="form" method="post" action="jstl2.jsp">
		<input type="hidden" name="doSubmit" value="true" />
		<table>
			<tr>
				<td>Application:<td>
				<td><input type="text" name="application" value="${param['application']}" /></td>
			</tr>
			<tr>
				<td>URL:<td>
				<td><input type="text" name="url" size="100" value="${param['url']}" /></td>
			</tr>
			<tr>
				<td>Expires:<td>
				<td><input type="text" name="expires" size="5"  value="${param['expires']}" /></td>
			</tr>
			<tr>
				<td>Name:<td>
				<td><input type="text" name="name" size="50"  value="${param['name']}" /></td>
			</tr>
			<tr>
				<td>Email:<td>
				<td><input type="text" name="email" size="50"  value="${param['email']}" /></td>
			</tr>
			<tr>
				<td>Password:<td>
				<td><input type="text" name="password" size="50"  value="${param['password']}" /></td>
			</tr>
		</table>
		<br />
		<c:if test="${param['doSubmit'] eq 'true'}">
			<ttr:url destination="${param['application']}" url="${param['url']}" var="newURL">
				<ttr:param name="name" value="${param['name']}"/>
				<ttr:param name="email" value="${param['email']}"/>
				<ttr:param name="password" value="${param['password']}"/>
			</ttr:url>
			<a href="${newURL}" target="_blank">
				${newURL}
			</a>
			<br />
		</c:if>
		<input type="submit" name="submit" value="Enviar" />
	</form>
</body>
</html>